

package com.googlecode.flac4j.format.metadata;


import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;


/**
 * Constants for <code>METADATA_BLOCK_PICTURE</code> type.
 *
 * @author Jin Kwon <jinahya at gmail.com>
 */
@XmlEnum(value = Integer.class)
public enum PictureType {


    /**
     * 0 - Other.
     */
    @XmlEnumValue(value = "0")
    OTHER(0),
    /**
     * 1 - 32x32 pixels 'file icon' (PNG only).
     */
    @XmlEnumValue(value = "1")
    FILE_ICON(1),
    /**
     * 2 - Other file icon.
     */
    @XmlEnumValue(value = "2")
    OTHER_FILE_ICON(2),
    /**
     * 3 - Cover (front).
     */
    @XmlEnumValue(value = "3")
    FRONT_COVER(3),
    /**
     * 4 - Cover (back).
     */
    @XmlEnumValue(value = "4")
    BACK_COVER(4),
    /**
     * 5 - Leaflet page.
     */
    @XmlEnumValue(value = "5")
    LEAFLET_PAGE(5),
    /**
     * 6 - Media (e.g. label side of CD).
     */
    @XmlEnumValue(value = "6")
    MEDIA(6),
    /**
     * 7 - Lead artist/lead performer/soloist.
     */
    @XmlEnumValue(value = "7")
    LEAD_ARTIST__LEAD_PERFORMER__SOLOIST(7),
    /**
     * 8 - Artist/performer.
     */
    @XmlEnumValue(value = "8")
    ARTIST__PERFORMER(8),
    /**
     * 9 - Conductor.
     */
    @XmlEnumValue(value = "9")
    CONDUCTOR(9),
    /**
     * 10 - Band/Orchestra.
     */
    @XmlEnumValue(value = "10")
    BAND__ORCHESTRA(10),
    /**
     * 11 - Composer.
     */
    @XmlEnumValue(value = "11")
    COMPOSER(11),
    /**
     * 12 - Lyricist/text writer.
     */
    @XmlEnumValue(value = "12")
    LYRICIST__TEXT_WRITER(12),
    /**
     * 13 - Recording Location.
     */
    @XmlEnumValue(value = "13")
    RECORDING_LOCATION(13),
    /**
     * 14 - During recording.
     */
    @XmlEnumValue(value = "14")
    DURING_RECORDING(14),
    /**
     * 15 - During performance.
     */
    @XmlEnumValue(value = "15")
    DURING_PERFORMANCE(15),
    /**
     * 16 - Movie/video screen capture.
     */
    @XmlEnumValue(value = "16")
    MOVIE__VIDO_SCREEN_CAPTURE(16),
    /**
     * 17 - A bright coloured fish.
     */
    @XmlEnumValue(value = "17")
    BRIGHT_COLORED_FISH(17),
    /**
     * 18 - Illustration.
     */
    @XmlEnumValue(value = "18")
    ILLUSTRATION(18),
    /**
     * 19 - Band/artist logotype.
     */
    @XmlEnumValue(value = "19")
    BAND__ARTIST_LOGOTYPE(19),
    /**
     * 20 - Publisher/Studio logotype.
     */
    @XmlEnumValue(value = "20")
    PUBLISHER__STUDIO_LOGOTYPE(20);


    /**
     * Finds PicutreType for given <code>value</code>.
     *
     * @param value picture type value
     * @return PictureType for given <code>value</code>.
     */
    public static PictureType valueOf(final int value) {

        for (PictureType pictureType : values()) {
            if (pictureType.getValue() == value) {
                return pictureType;
            }
        }

        throw new IllegalArgumentException("illegal value: " + value);
    }


    /**
     * Creates a new instance.
     *
     * @param value value
     */
    private PictureType(final int value) {
        this.value = value;
    }


    /**
     * Returns value.
     *
     * @return value
     */
    public int getValue() {
        return value;
    }


    /** value. */
    private final int value;


}

